let promise = new Promise( (resolve,reject) => {
    setTimeout(() => {
        let v = Math.random();
        if (v <= 0.5) {
            resolve("成功了：" + v);
        } else {
            reject("失败了：" + v);
        }
    })
})

promise.then(res => {
    console.log(res);
}).catch(res => {
    console.log(res);
}).finally(res => {
    console.log("都会执行 = ",res)
});